<template>
<div class="wrapper">
    <swiper :options="swiperOption" v-if="showSwiper">
      <swiper-slide v-for = "item of swiperList" :key=item.id >
        <img :src="item.imgUrl" alt="">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
  </swiper>
</div>

</template>

<script>
  export default {
    name: 'HomeSwiper',
    data() {
      return {
        swiperOption: {
          loop:true,
          pagination:'.swiper-pagination',
        }
      }
    },
    props:{
      swiperList:Array
    },

    mounted(){
    },
    computed:{
      showSwiper(){
        return this.swiperList.length
      }
    }
  }
</script>
<style lang="less">
  .my-bullet-active{
    background-color:red;
  }

  .wrapper{
    overflow: hidden;
    height: 0;
    width:100%;
    padding-bottom: 31%;
    background-color: #ccc;
    & /deep/ .swiper-pagination-bullet-active{
      background: #fff !important;
    }
    img{
      width: 100%;
    }
  }
</style>